package com.janlei.tdd.practise;

import com.janlei.tdd.practise.Unit;

public class TransferUnit {

    public <T extends Unit> T apply(Unit src, Class<T> clazz) {
        boolean illegal = src == null || clazz == null;
        if (illegal) {
            throw new IllegalArgumentException("参数不能为空！");
        }
        return src.transfer(clazz);
    }
}

